Round Functions

Kalyna State Matrix

Substitution Box (π)(\pi)


Shift Rows (τ)(\tau)

b0b1b2b3b4b5b6b7b0b1b2b3b4b5b6b7b8b9b10b11b12b13b14b15b8b9b10b11b12b13b14b15\begin{array}{|c|c|} \hline \mathtt{b_0} & \texttt{\hspace{3mm}} \\ \hline \mathtt{b_1} & \mathtt{ } \\ \hline \mathtt{b_2} & \mathtt{} \\ \hline \mathtt{b_3} & \mathtt{} \\ \hline \mathtt{b_4} & \mathtt{} \\ \hline \mathtt{b_5} & \mathtt{} \\ \hline \mathtt{b_6} & \mathtt{} \\ \hline \mathtt{b_7} & \mathtt{} \\ \hline \end{array} \to \begin{array}{|c|c|} \hline \mathtt{b_0} & \mathtt{} \\ \hline \mathtt{b_1} & \mathtt{} \\ \hline \mathtt{b_2} & \mathtt{} \\ \hline \mathtt{b_3} & \mathtt{} \\ \hline \mathtt{} & \mathtt{b_4} \\ \hline \mathtt{} & \mathtt{b_5} \\ \hline \mathtt{} & \mathtt{b_6} \\ \hline \mathtt{} & \mathtt{b_7} \\ \hline \end{array} \hspace{10mm} \begin{array}{|c|c|} \hline \texttt{\hspace{4mm}} & \mathtt{b_8} \\ \hline \mathtt{} & \mathtt{b_9} \\ \hline \mathtt{} & \mathtt{b_{10}} \\ \hline \mathtt{} & \mathtt{b_{11}} \\ \hline \mathtt{} & \mathtt{b_{12}} \\ \hline \mathtt{} & \mathtt{b_{13}} \\ \hline \mathtt{} & \mathtt{b_{14}} \\ \hline \mathtt{} & \mathtt{b_{15}} \\ \hline \end{array} \to \begin{array}{|c|c|} \hline \mathtt{} & \mathtt{b_8} \\ \hline \mathtt{} & \mathtt{b_9} \\ \hline \mathtt{} & \mathtt{b_{10}} \\ \hline \mathtt{} & \mathtt{b_{11}} \\ \hline \mathtt{b_{12}} & \mathtt{} \\ \hline \mathtt{b_{13}} & \mathtt{} \\ \hline \mathtt{b_{14}} & \mathtt{} \\ \hline \mathtt{b_{15}} & \mathtt{} \\ \hline \end{array}
b8b9b10b11b12b13b14b15b8b9b10b11b12b13b14b15\begin{array}{|c|c|c|c|}\hline \texttt{\hspace{4mm}} & \mathtt{b_8} & \texttt{\hspace{4mm}}&\texttt{\hspace{4mm}} \\ \hline \mathtt{} & \mathtt{b_9} & \mathtt{} & \mathtt{} \\ \hline \mathtt{} & \mathtt{b_{10}} & \mathtt{} & \mathtt{} \\ \hline \mathtt{} & \mathtt{b_{11}} & \mathtt{} & \mathtt{} \\ \hline \mathtt{} & \mathtt{b_{12}} & \mathtt{} & \mathtt{} \\ \hline \mathtt{} & \mathtt{b_{13}} & \mathtt{} & \mathtt{} \\ \hline \mathtt{} & \mathtt{b_{14}} & \mathtt{} & \mathtt{} \\ \hline \mathtt{} & \mathtt{b_{15}} & \mathtt{} & \mathtt{} \\ \hline \end{array} \to \begin{array}{|c|c|c|c|}\hline \mathtt{} & \mathtt{b_8} & \mathtt{} & \mathtt{} \\ \hline \mathtt{} & \mathtt{b_9} & \mathtt{} & \mathtt{} \\ \hline \mathtt{} & \mathtt{} & \mathtt{b_{10}} & \mathtt{} \\ \hline \mathtt{} & \mathtt{} & \mathtt{b_{11}} & \mathtt{} \\ \hline \mathtt{} & \mathtt{} & \mathtt{} & \mathtt{b_{12}} \\ \hline \mathtt{} & \mathtt{} & \mathtt{} & \mathtt{b_{13}} \\ \hline \mathtt{b_{14}} & \mathtt{} & \mathtt{} & \mathtt{} \\ \hline \mathtt{b_{15}} & \mathtt{} & \mathtt{} & \mathtt{} \\ \hline \end{array}
b0b1b2b3b4b5b6b7b0b1b2b3b4b5b6b7\begin{array}{|c|c|c|c|c|c|c|c|} \hline \mathtt{b_0} & \texttt{\hspace{3mm}} & \texttt{\hspace{3mm}} & \texttt{\hspace{3mm}} & \texttt{\hspace{3mm}} & \texttt{\hspace{3mm}} & \texttt{\hspace{3mm}} & \texttt{\hspace{3mm}}\\ \hline \mathtt{b_1} & & & & & & & \\ \hline \mathtt{b_2} & & & & & & & \\ \hline \mathtt{b_3} & & & & & & & \\ \hline \mathtt{b_4} & & & & & & & \\ \hline \mathtt{b_5} & & & & & & & \\ \hline \mathtt{b_6} & & & & & & & \\ \hline \mathtt{b_7} & & & & & & & \\ \hline \end{array} \to \begin{array}{|c|c|c|c|c|c|c|c|} \hline \mathtt{b_0} & & & & & & & \\ \hline & \mathtt{b_1} & & & & & & \\ \hline & & \mathtt{b_2} & & & & & \\ \hline & & & \mathtt{b_3} & & & & \\ \hline & & & & \mathtt{b_4} & & & \\ \hline & & & & & \mathtt{b_5} & & \\ \hline & & & & & &\mathtt{b_6} & \\ \hline & & & & & & & \mathtt{b_7} \\ \hline \end{array}

Mix Columns (ψ)(\psi)


XOR\operatorname{XOR} Round Key (κlKv)(\kappa_l^{K_v})

b0b8b1b9b2b10b3b11b4b12b5b13b6b14b7b15k0k8k1k9k2k10k3k11k4k12k5k13k6k14k7k15=b0k0b8k8b1k1b9k9b2k2b10k10b3k3b11k11b4k4b12k12b5k5b13k13b6k6b14k14b7k7b15k15\begin{array}{|c|c|} \hline \mathtt{b_0} & \mathtt{b_8} \\ \hline \mathtt{b_1} & \mathtt{b_9} \\ \hline \mathtt{b_2} & \mathtt{b_{10}} \\ \hline \mathtt{b_3} & \mathtt{b_{11}} \\ \hline \mathtt{b_4} & \mathtt{b_{12}} \\ \hline \mathtt{b_5} & \mathtt{b_{13}} \\ \hline \mathtt{b_6} & \mathtt{b_{14}} \\ \hline \mathtt{b_7} & \mathtt{b_{15}} \\ \hline \end{array} \oplus \begin{array}{|c|c|} \hline \mathtt{k_0} & \mathtt{k_8} \\ \hline \mathtt{k_1} & \mathtt{k_9} \\ \hline \mathtt{k_2} & \mathtt{k_{10}} \\ \hline \mathtt{k_3} & \mathtt{k_{11}} \\ \hline \mathtt{k_4} & \mathtt{k_{12}} \\ \hline \mathtt{k_5} & \mathtt{k_{13}} \\ \hline \mathtt{k_6} & \mathtt{k_{14}} \\ \hline \mathtt{k_7} & \mathtt{k_{15}} \\ \hline \end{array} = \begin{array}{|c|c|} \hline \mathtt{b_0 \oplus k_0} & \mathtt{b_8 \oplus k_8} \\ \hline \mathtt{b_1 \oplus k_1} & \mathtt{b_9 \oplus k_9} \\ \hline \mathtt{b_2 \oplus k_2} & \mathtt{b_{10} \oplus k_{10}} \\ \hline \mathtt{b_3 \oplus k_3} & \mathtt{b_{11} \oplus k_{11}} \\ \hline \mathtt{b_4 \oplus k_4} & \mathtt{b_{12} \oplus k_{12}} \\ \hline \mathtt{b_5 \oplus k_5} & \mathtt{b_{13} \oplus k_{13}} \\ \hline \mathtt{b_6 \oplus k_6} & \mathtt{b_{14} \oplus k_{14}} \\ \hline \mathtt{b_7 \oplus k_7} & \mathtt{b_{15} \oplus k_{15}} \\ \hline \end{array}

Add Round Key (ηlKv)(\eta_l^{K_v})

b0b8b1b9b2b10b3b11b4b12b5b13b6b14b7b15k0k8k1k9k2k10k3k11k4k12k5k13k6k14k7k15b7b6b5b4b3b2b1b0b15b14b13b12b11b10b9b8k7k6k5k4k3k2k1k0k15k14k13k12k11k10k9k8c0c8c1c9c2c10c3c11c4c12c5c13c6c14c7c15\begin{array}{|c|c|} \hline \mathtt{b_0} & \mathtt{b_8} \\ \hline \mathtt{b_1} & \mathtt{b_9} \\ \hline \mathtt{b_2} & \mathtt{b_{10}} \\ \hline \mathtt{b_3} & \mathtt{b_{11}} \\ \hline \mathtt{b_4} & \mathtt{b_{12}} \\ \hline \mathtt{b_5} & \mathtt{b_{13}} \\ \hline \mathtt{b_6} & \mathtt{b_{14}} \\ \hline \mathtt{b_7} & \mathtt{b_{15}} \\ \hline \end{array} \boxplus \begin{array}{|c|c|} \hline \mathtt{k_0} & \mathtt{k_8} \\ \hline \mathtt{k_1} & \mathtt{k_9} \\ \hline \mathtt{k_2} & \mathtt{k_{10}} \\ \hline \mathtt{k_3} & \mathtt{k_{11}} \\ \hline \mathtt{k_4} & \mathtt{k_{12}} \\ \hline \mathtt{k_5} & \mathtt{k_{13}} \\ \hline \mathtt{k_6} & \mathtt{k_{14}} \\ \hline \mathtt{k_7} & \mathtt{k_{15}} \\ \hline \end{array}\\ \downarrow\\ \begin{array}{|c|c|} \hline \mathtt{b_7||b_6||b_5||b_4||b_3||b_2||b_1||b_0} & \mathtt{b_{15}||b_{14}||b_{13}||b_{12}||b_{11}||b_{10}||b_9||b_8|} \\ \boxplus & \boxplus\\ \mathtt{k_7||k_6||k_5||k_4||k_3||k_2||k_1||k_0} & \mathtt{k_{15}||k_{14}||k_{13}||k_{12}||k_{11}||k_{10}||k_9||k_8|}\\ \hline \end{array}\\ \downarrow\\ \begin{array}{|c|c|} \hline \mathtt{c_0} & \mathtt{c_8} \\ \hline \mathtt{c_1} & \mathtt{c_9} \\ \hline \mathtt{c_2} & \mathtt{c_{10}} \\ \hline \mathtt{c_3} & \mathtt{c_{11}} \\ \hline \mathtt{c_4} & \mathtt{c_{12}} \\ \hline \mathtt{c_5} & \mathtt{c_{13}} \\ \hline \mathtt{c_6} & \mathtt{c_{14}} \\ \hline \mathtt{c_7} & \mathtt{c_{15}} \\ \hline \end{array}